#include <stdio.h>
#include <string.h>

#define DEF_STRUCT(struct_name, struct_def) \
	struct_def \
	static char struct_name##files_names[128][128] = {'\0'}; \
	static inline const char* struct_name##_get_field_name(int filedno) { \
		char* pos = #struct_def; \
		int i=0; \
		int line=0; \
		while(*pos){ \
			if(*pos == '{' ||  *pos == ';'){  \
				line++; \
				i = 0; \
				pos++; \
			} \
			struct_name##files_names[line][i] = *pos; \
			pos++;   \
			i++; \
		} \
		return struct_name##files_names[filedno]	;		 \
	}

DEF_STRUCT(TTT,
	struct TTT {
		int a;
        void (*hello)(void*);
		float b;
	}; 
)

int main()
{
	struct TTT test = {1,NULL};

	printf("test.a = %d\n", test.a);
	printf("filed 1 = %s\n", TTT_get_field_name(1));
	printf("filed 2 = %s\n", TTT_get_field_name(2));
	return(0);
}
